<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href='<?php echo  base_url(); ?>css/main.css' type="text/css"/>   
<script>
function selectAll(id)
{ 
    var obj = document.getElementsByTagName('input');
    for (i = 0; i < obj.length; i++ )
    {    if(obj[i].className=="ids"){
            obj[i].checked = id.checked;
	  }
    }
}
</script>
</head>

<body>
<div class="content">
<form method="post">
<table>
    	<tr>
        	<th><input type="checkbox"  onclick="javascript:selectAll(this);" />ID</th>
            <th>排序</th>
            <th>分类名称</th>
            <th>新闻标题</th>
            <th>新闻内容</th>
            <th>附件</th>
            <th>添加时间</th>
            <th>操作</th>
        </tr>
        <? foreach($results as $res){ ?>
        <tr>
            <td><input type="checkbox" name="ids[]" class="ids" value="<?php echo $res->id; ?>" /><?php echo $res->id; ?></td>
           <td><?php echo $res->pai; ?></td>
            <td><?php echo $res->type_id; ?></td>
            
            <td><?php echo $res->title; ?></td>
            <td><?php $strip_content=strip_tags($res->content); echo utf8Substr($strip_content,0,30); ?></td>
            <td><?php echo $res->attachment_title ?></td>           
            <td><?php echo date('Y-m-d',$res->add_time); ?></td>
            <td><a href="<?php echo $url.'edit?id='.$res->id;  ?>">编辑</a><!--|<a href="<?php echo $url.'delete_news?id='.$res->id;  ?>">删除--></td>
        </tr>
        <?php } ?>
        <tr align="left"><td colspan="8" align="left">&nbsp;&nbsp;<input type="submit" class="button" value="删除"></td></tr>
        <tr><td colspan="8"><?php echo $this->pagination->create_links(); ?>   </td></tr>
    </table>
    </form>
    </div>
  
		
 

</body>
</html>